<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('新生儿疾病记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>新生儿名称：</label>
                                <input type="text" name="newbornName"/>
                            </li>
                            <li>
                                <label>疾病名称：</label>
                                <input type="text" name="diseaseName"/>
                            </li>
                            <li>
                                <label>疾病状态：</label>
                                <select name="status">
                                    <option value="">请选择</option>
                                    <option value="1">待治疗</option>
                                    <option value="2">治疗中</option>
                                    <option value="3">治疗完成待复检</option>
                                    <option value="4">治疗完成</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/diseaseRecord";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "新生儿疾病记录",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '疾病状态',
                    visible: false
                },
                    {
                        field: 'newbornName',
                        title: '新生儿姓名'
                    },
                    {
                        field: 'newbornSex',
                        title: '新生儿性别',
                        formatter: function (value, row, index) {
                            if(value === 1){
                                return '男'
                            }else if(value === 2){
                                return '女'
                            }
                        }
                    },
                    {
                        field: 'hospitalName',
                        title: '所在医院名称'
                    },
                    {
                        field: 'momName',
                        title: '母亲姓名'
                    },
                {
                    field: 'diseaseName',
                    title: '疾病名称'
                },
                {
                    field: 'status',
                    title: '疾病状态',
                    formatter: function (value, row, index) {
                        if(value === 1){
                            return '待治疗'
                        }else if(value === 2){
                            return '治疗中'
                        }else if(value === 3){
                            return '治疗完成待复检'
                        }else if(value === 4){
                            return '治疗完成'
                        }
                    }
                },
               /* {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        return actions.join('');
                    }
                }*/]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
